package org.example.controller;

import org.example.mapper.UserMapper;
import org.example.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/mybatis")
public class MyController {

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/find")
    public String find() {
        List<User> users = userMapper.selectAll();
        return users.toString();
    }
}
